<%@ page import="com.webamc.common.enums.Fields" %>
<%@ page import="com.webamc.common.enums.Params" %>
<%@ page import="com.webamc.model.AMCOrder" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script type="text/javascript" src="../calendar.js" ></script>

<link rel="stylesheet" href="../webamc.css"/>
<div class="action-header">UPDATE AMCORDER</div>

<%
    AMCOrder order = (AMCOrder) request.getAttribute(Params.BEAN);
    if (order == null) {
%>
No amcorder! <a href="amcorder.html?action=browse">click here</a> to browse list.
<%
        return;
    }

%>
<jsp:include page="msgs.jsp"/>

<form action="amcorder.html?action=update" method="post">
    <table class="browse-table" border="1">
        <col width="20%">
        <col width="80%">

        <tr>
            <td>AMC OrderId</td>
            <td><input readonly name="<%=Fields.ORDERID%>" value="<%=order.getOrderId()%>"/></td>
        </tr>
        <tr>
            <td>Duration</td>
            <td><input readonly name="<%=Fields.TERMLENGTH%>" value="<%=order.getTermLength()%>"/></td>
        </tr>
        <tr>
            <td>AMC Schedule</td>
            <td>
                <%  request.setAttribute(Params.KEY,Fields.AMCSCHEDULE);
                    request.setAttribute(Params.SEL,order.getAmcSchedule());
                %>
                <jsp:include page="combo-util.jsp" />

            </td>
        </tr>
        <jsp:include page="order-update.jsp"/>

        <tr>
            <td colspan="2" align="center">
                <button type="submit">OK</button>
                <a href="amcorder.html?action=view&<%=Fields.ORDERID%>=<%=order.getOrderId()%>">
                    <button type="button">Cancel</button>
                </a>
            </td>
        </tr>
    </table>

</form>